home *** CD-ROM | disk | FTP | other *** search
- Path: news.clark.net!not-for-mail
- From: gusty@clark.net (Harlan Messinger)
- Newsgroups: comp.lang.c++
- Subject: Static Local Variable in Non-Static Member Function
- Date: 8 Mar 1996 16:45:32 GMT
- Organization: Clark Internet Services, Inc., Ellicott City, MD USA
- Message-ID: <4hpo7c$9qv@clarknet.clark.net>
- NNTP-Posting-Host: explorer.clark.net
- Mime-Version: 1.0
- Content-Type: TEXT/PLAIN; charset=ISO-8859-1
- Content-Transfer-Encoding: 8bit
- X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
-
- Suppose we have
-
- class Foo {
- ...
- void func() {
- static int flag;
- ...
- }
- };
-
- Foo a, b;
-
- Is flag in a.func() the same as flag in b.func(), or do a.func() and
- b.func() have their own separate static locals named flag? That is, is
- flag static or non-static to the class?
-
-